/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ivanbiz.kelas;

import com.ivanbiz.generic.GenericDAOImpl;
import java.util.List;
import org.hibernate.Query;

/**
 *
 * @author User
 */
public class AccountKelasDAOImpl extends GenericDAOImpl implements AccountKelasDAO {

    public List getAccountByKelas(String id) throws Exception {
        Query query = getSessionFactory().getCurrentSession().createQuery("from AccountKelas a where a.kelas.id:=id");
        query.setString("id", id);
        return query.list();
    }

    public List getAccountBySiswa(long id) throws Exception {
        Query query = getSessionFactory().getCurrentSession().createQuery("from AccountKelas a where a.siswa.id:=id");
        query.setParameter("id", id);
        return query.list();
    }
}
